package com.hightrast.service.compareToData.stage.impl;

import com.hightrast.service.api.entity.RastOrders;
import com.hightrast.service.compareToData.stage.EntityComparator;

import java.util.Objects;

/**
 * 订单 比较策略实现
 */
public class RastOrderComparator implements EntityComparator<RastOrders> {
    @Override
    public boolean areEqual(RastOrders newEntity, RastOrders oldEntity) {
        return Objects.equals(newEntity.getClosedAt(), oldEntity.getClosedAt()) &&
                Objects.equals(newEntity.getUpdatedAt(), oldEntity.getUpdatedAt()) &&
                Objects.equals(newEntity.getTotalPrice(), oldEntity.getTotalPrice()) &&
                Objects.equals(newEntity.getSubtotalPrice(), oldEntity.getSubtotalPrice()) &&
                Objects.equals(newEntity.getTotalTax(), oldEntity.getTotalTax()) &&
                Objects.equals(newEntity.getFinancialStatus(), oldEntity.getFinancialStatus()) &&
                Objects.equals(newEntity.getConfirmed(), oldEntity.getConfirmed()) &&
                Objects.equals(newEntity.getTotalDiscounts(), oldEntity.getTotalDiscounts()) &&
                Objects.equals(newEntity.getTotalLineItemsPrice(), oldEntity.getTotalLineItemsPrice()) &&
                Objects.equals(newEntity.getName(), oldEntity.getName()) &&
                Objects.equals(newEntity.getOrderNumber(), oldEntity.getOrderNumber()) &&
                Objects.equals(newEntity.getCurrentTotalPrice(), oldEntity.getCurrentTotalPrice()) &&
                Objects.equals(newEntity.getTotalOutstanding(), oldEntity.getTotalOutstanding()) &&
                Objects.equals(newEntity.getCurrentSubtotalPrice(), oldEntity.getCurrentSubtotalPrice()) &&
                Objects.equals(newEntity.getFulfillmentStatus(), oldEntity.getFulfillmentStatus())
                ;
    }
}